package router

import (
	"api/handler"
	"github.com/gin-gonic/gin"
)

func Router(r *gin.Engine) {
	api := r.Group("/api")
	{
		eat := api.Group("/eat")
		{
			eat.POST("/add", handler.EatAdd)
			eat.POST("/update", handler.EatUpdate)
		}

		user := api.Group("/user")
		{
			user.POST("/register", handler.Register)
			user.POST("/login", handler.Login)
		}
		good := api.Group("/good")
		{
			//good.Use(pkg.JWTAuth("2210a"))
			good.GET("/list", handler.List)
			good.GET("/add", handler.AddOrder)
			good.GET("/listorder", handler.ListOrder)
			good.GET("/orderinfo", handler.OrderInfo)
			good.GET("/del", handler.Del)
		}
	}
}
